from peewee import *

database = MySQLDatabase('dresser_db', **{'charset': 'utf8', 'sql_mode': 'PIPES_AS_CONCAT', 'use_unicode': True, 'host': 'localhost', 'user': 'root', 'password': 'root'})

class UnknownField(object):
    def __init__(self, *_, **__): pass

class BaseModel(Model):
    class Meta:
        database = database

class Age(BaseModel):
    description = CharField(null=True)
    name = CharField(unique=True)

    class Meta:
        table_name = 'age'

class Style(BaseModel):
    description = CharField(null=True)
    name = CharField(unique=True)

    class Meta:
        table_name = 'style'

class AgeToStyle(BaseModel):
    age = ForeignKeyField(column_name='age_id', field='id', model=Age, null=True)
    score = IntegerField(null=True)
    style = ForeignKeyField(column_name='style_id', field='id', model=Style)

    class Meta:
        table_name = 'age_to_style'

class AuthGroup(BaseModel):
    name = CharField(unique=True)

    class Meta:
        table_name = 'auth_group'

class DjangoContentType(BaseModel):
    app_label = CharField()
    model = CharField()

    class Meta:
        table_name = 'django_content_type'
        indexes = (
            (('app_label', 'model'), True),
        )

class AuthPermission(BaseModel):
    codename = CharField()
    content_type = ForeignKeyField(column_name='content_type_id', field='id', model=DjangoContentType)
    name = CharField()

    class Meta:
        table_name = 'auth_permission'
        indexes = (
            (('content_type', 'codename'), True),
        )

class AuthGroupPermissions(BaseModel):
    group = ForeignKeyField(column_name='group_id', field='id', model=AuthGroup)
    permission = ForeignKeyField(column_name='permission_id', field='id', model=AuthPermission)

    class Meta:
        table_name = 'auth_group_permissions'
        indexes = (
            (('group', 'permission'), True),
        )

class AuthUser(BaseModel):
    date_joined = DateTimeField()
    email = CharField()
    first_name = CharField()
    is_active = IntegerField()
    is_staff = IntegerField()
    is_superuser = IntegerField()
    last_login = DateTimeField(null=True)
    last_name = CharField()
    password = CharField()
    username = CharField(unique=True)

    class Meta:
        table_name = 'auth_user'

class AuthUserGroups(BaseModel):
    group = ForeignKeyField(column_name='group_id', field='id', model=AuthGroup)
    user = ForeignKeyField(column_name='user_id', field='id', model=AuthUser)

    class Meta:
        table_name = 'auth_user_groups'
        indexes = (
            (('user', 'group'), True),
        )

class AuthUserUserPermissions(BaseModel):
    permission = ForeignKeyField(column_name='permission_id', field='id', model=AuthPermission)
    user = ForeignKeyField(column_name='user_id', field='id', model=AuthUser)

    class Meta:
        table_name = 'auth_user_user_permissions'
        indexes = (
            (('user', 'permission'), True),
        )

class ClothHigher(BaseModel):
    name = CharField(unique=True)

    class Meta:
        table_name = 'cloth_higher'

class ClothMedium(BaseModel):
    cloth_higher = ForeignKeyField(column_name='cloth_higher_id', field='id', model=ClothHigher, null=True)
    name = CharField(unique=True)

    class Meta:
        table_name = 'cloth_medium'

class ClothBasic(BaseModel):
    cloth_medium = ForeignKeyField(column_name='cloth_medium_id', field='id', model=ClothMedium, null=True)
    name = CharField(unique=True)

    class Meta:
        table_name = 'cloth_basic'

class ClothBasicPairing(BaseModel):
    cloth_basic_1 = ForeignKeyField(column_name='cloth_basic_1_id', field='id', model=ClothBasic, null=True)
    cloth_basic_2 = ForeignKeyField(backref='cloth_basic_cloth_basic_2_set', column_name='cloth_basic_2_id', field='id', model=ClothBasic, null=True)
    model = CharField(null=True)

    class Meta:
        table_name = 'cloth_basic_pairing'

class OldColorMedium(BaseModel):
    color_tag = CharField(null=True)
    name = CharField(unique=True)

    class Meta:
        table_name = 'old_color_medium'

class OldColorBasic(BaseModel):
    color_medium = ForeignKeyField(column_name='color_medium_id', field='id', model=OldColorMedium, null=True)
    color_tag = CharField(null=True)
    name = CharField(unique=True)

    class Meta:
        table_name = 'old_color_basic'

class ClothColorToStyle(BaseModel):
    cloth_basic = ForeignKeyField(column_name='cloth_basic_id', field='id', model=ClothBasic, null=True)
    color_basic = ForeignKeyField(column_name='color_basic_id', field='id', model=OldColorBasic, null=True)
    style = ForeignKeyField(column_name='style_id', field='id', model=Style, null=True)

    class Meta:
        table_name = 'cloth_color_to_style'

class ColorMedium(BaseModel):
    color_tag = CharField(null=True)
    name = CharField(unique=True)

    class Meta:
        table_name = 'color_medium'

class ColorBasic(BaseModel):
    color_medium = ForeignKeyField(column_name='color_medium_id', field='id', model=ColorMedium, null=True)
    color_tag = CharField(null=True)
    name = CharField(unique=True)

    class Meta:
        table_name = 'color_basic'

class Color(BaseModel):
    color_basic = ForeignKeyField(column_name='color_basic_id', field='id', model=ColorBasic)
    hlc = CharField()
    rgb = CharField()

    class Meta:
        table_name = 'color'

class DjangoAdminLog(BaseModel):
    action_flag = IntegerField()
    action_time = DateTimeField()
    change_message = TextField()
    content_type = ForeignKeyField(column_name='content_type_id', field='id', model=DjangoContentType, null=True)
    object_id = TextField(null=True)
    object_repr = CharField()
    user = ForeignKeyField(column_name='user_id', field='id', model=AuthUser)

    class Meta:
        table_name = 'django_admin_log'

class DjangoMigrations(BaseModel):
    app = CharField()
    applied = DateTimeField()
    name = CharField()

    class Meta:
        table_name = 'django_migrations'

class DjangoSession(BaseModel):
    expire_date = DateTimeField(index=True)
    session_data = TextField()
    session_key = CharField(primary_key=True)

    class Meta:
        table_name = 'django_session'

class Occasion(BaseModel):
    description = CharField(null=True)
    general_occasion = CharField()
    name = CharField(unique=True)

    class Meta:
        table_name = 'occasion'

class OccasionToStyle(BaseModel):
    occasion = ForeignKeyField(column_name='occasion_id', field='id', model=Occasion, null=True)
    score = IntegerField(null=True)
    style = ForeignKeyField(column_name='style_id', field='id', model=Style, null=True)

    class Meta:
        table_name = 'occasion_to_style'

class OldColor(BaseModel):
    color_basic = ForeignKeyField(column_name='color_basic_id', field='id', model=OldColorBasic)
    hlc = CharField(null=True)
    rgb = CharField()

    class Meta:
        table_name = 'old_color'

